package com.afalon.cloud.contracts.competition;

import java.net.URI;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@PersistenceCapable
@XmlRootElement(name = "match")
@XmlAccessorType(XmlAccessType.NONE)
public class Match {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key matchKey;
	
	@XmlElement(name="datetime")
	@Persistent
	private String dateTime;
	
	@XmlElement(name="matchuri")
	public URI matchUri;
	
	public Match() 
	{
		
	}

	public Key getMatchKey() {
		return matchKey;
	}
	
	@XmlElement(name="matchid")
	public String getMatchId() {
		return KeyFactory.keyToString(this.getMatchKey());
	}

	public String getDateTime() {
		return dateTime;
	}

	public void setDateTime(String dateTime) {
		this.dateTime = dateTime;
	}

}
